Integrand size = 19, antiderivative size = 202 \[ \int \left (a+b x^n\right )^p \left (c+d x^n\right )^2 \, dx=-\frac {d (a d (1+n)-b c (1+n (3+p))) x \left (a+b x^n\right )^{1+p}}{b^2 (1+n+n p) (1+n (2+p))}+\frac {d x \left (a+b x^n\right )^{1+p} \left (c+d x^n\right )}{b (1+2 n+n p)}-\frac {(b c (1+n+n p) (a d-b c (1+n (2+p)))-a d (a d (1+n)-b c (1+n (3+p)))) x \left (a+b x^n\right )^p \left (1+\frac {b x^n}{a}\right )^{-p} \operatorname {Hypergeometric2F1}\left (\frac {1}{n},-p,1+\frac {1}{n},-\frac {b x^n}{a}\right )}{b^2 (1+n+n p) (1+n (2+p))} \]
-d*(a*d*(1+n)-b*c*(1+n*(3+p)))*x*(a+b*x^n)^(p+1)/b^2/(n*p+n+1)/(1+n*(2+p)) +d*x*(a+b*x^n)^(p+1)*(c+d*x^n)/b/(n*p+2*n+1)-(b*c*(n*p+n+1)*(a*d-b*c*(1+n* (2+p)))-a*d*(a*d*(1+n)-b*c*(1+n*(3+p))))*x*(a+b*x^n)^p*hypergeom([-p, 1/n] ,[1+1/n],-b*x^n/a)/b^2/(n*p+n+1)/(1+n*(2+p))/((1+b*x^n/a)^p)
Time = 5.20 (sec) , antiderivative size = 140, normalized size of antiderivative = 0.69 \[ \int \left (a+b x^n\right )^p \left (c+d x^n\right )^2 \, dx=\frac {x \left (a+b x^n\right )^p \left (1+\frac {b x^n}{a}\right )^{-p} \left (2 c d (1+2 n) x^n \operatorname {Hypergeometric2F1}\left (1+\frac {1}{n},-p,2+\frac {1}{n},-\frac {b x^n}{a}\right )+(1+n) \left (d^2 x^{2 n} \operatorname {Hypergeometric2F1}\left (2+\frac {1}{n},-p,3+\frac {1}{n},-\frac {b x^n}{a}\right )+c^2 (1+2 n) \operatorname {Hypergeometric2F1}\left (\frac {1}{n},-p,1+\frac {1}{n},-\frac {b x^n}{a}\right )\right )\right )}{(1+n) (1+2 n)} \]
(x*(a + b*x^n)^p*(2*c*d*(1 + 2*n)*x^n*Hypergeometric2F1[1 + n^(-1), -p, 2 + n^(-1), -((b*x^n)/a)] + (1 + n)*(d^2*x^(2*n)*Hypergeometric2F1[2 + n^(-1 ), -p, 3 + n^(-1), -((b*x^n)/a)] + c^2*(1 + 2*n)*Hypergeometric2F1[n^(-1), -p, 1 + n^(-1), -((b*x^n)/a)])))/((1 + n)*(1 + 2*n)*(1 + (b*x^n)/a)^p)
Time = 0.45 (sec) , antiderivative size = 188, normalized size of antiderivative = 0.93, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {933, 25, 913, 779, 778}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \left (c+d x^n\right )^2 \left (a+b x^n\right )^p \, dx\) |
\(\Big \downarrow \) 933 |
\(\displaystyle \frac {\int -\left (b x^n+a\right )^p \left (d (a d (n+1)-b (n (p+3) c+c)) x^n+c (a d-b (n (p+2) c+c))\right )dx}{b (n (p+2)+1)}+\frac {d x \left (c+d x^n\right ) \left (a+b x^n\right )^{p+1}}{b (n (p+2)+1)}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {d x \left (c+d x^n\right ) \left (a+b x^n\right )^{p+1}}{b (n (p+2)+1)}-\frac {\int \left (b x^n+a\right )^p \left (d (a d (n+1)-b (n (p+3) c+c)) x^n+c (a d-b (n (p+2) c+c))\right )dx}{b (n (p+2)+1)}\) |
\(\Big \downarrow \) 913 |
\(\displaystyle \frac {d x \left (c+d x^n\right ) \left (a+b x^n\right )^{p+1}}{b (n (p+2)+1)}-\frac {\left (-\frac {a d (a d (n+1)-b (c n (p+3)+c))}{b (n p+n+1)}+a c d-b c (c n (p+2)+c)\right ) \int \left (b x^n+a\right )^pdx+\frac {d x \left (a+b x^n\right )^{p+1} (a d (n+1)-b (c n (p+3)+c))}{b (n p+n+1)}}{b (n (p+2)+1)}\) |
\(\Big \downarrow \) 779 |
\(\displaystyle \frac {d x \left (c+d x^n\right ) \left (a+b x^n\right )^{p+1}}{b (n (p+2)+1)}-\frac {\left (a+b x^n\right )^p \left (\frac {b x^n}{a}+1\right )^{-p} \left (-\frac {a d (a d (n+1)-b (c n (p+3)+c))}{b (n p+n+1)}+a c d-b c (c n (p+2)+c)\right ) \int \left (\frac {b x^n}{a}+1\right )^pdx+\frac {d x \left (a+b x^n\right )^{p+1} (a d (n+1)-b (c n (p+3)+c))}{b (n p+n+1)}}{b (n (p+2)+1)}\) |
\(\Big \downarrow \) 778 |
\(\displaystyle \frac {d x \left (c+d x^n\right ) \left (a+b x^n\right )^{p+1}}{b (n (p+2)+1)}-\frac {x \left (a+b x^n\right )^p \left (\frac {b x^n}{a}+1\right )^{-p} \left (-\frac {a d (a d (n+1)-b (c n (p+3)+c))}{b (n p+n+1)}+a c d-b c (c n (p+2)+c)\right ) \operatorname {Hypergeometric2F1}\left (\frac {1}{n},-p,1+\frac {1}{n},-\frac {b x^n}{a}\right )+\frac {d x \left (a+b x^n\right )^{p+1} (a d (n+1)-b (c n (p+3)+c))}{b (n p+n+1)}}{b (n (p+2)+1)}\) |
(d*x*(a + b*x^n)^(1 + p)*(c + d*x^n))/(b*(1 + n*(2 + p))) - ((d*(a*d*(1 + n) - b*(c + c*n*(3 + p)))*x*(a + b*x^n)^(1 + p))/(b*(1 + n + n*p)) + ((a*c *d - b*c*(c + c*n*(2 + p)) - (a*d*(a*d*(1 + n) - b*(c + c*n*(3 + p))))/(b* (1 + n + n*p)))*x*(a + b*x^n)^p*Hypergeometric2F1[n^(-1), -p, 1 + n^(-1), -((b*x^n)/a)])/(1 + (b*x^n)/a)^p)/(b*(1 + n*(2 + p)))
3.4.14.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^p*x*Hypergeometric2F 1[-p, 1/n, 1/n + 1, (-b)*(x^n/a)], x] /; FreeQ[{a, b, n, p}, x] && !IGtQ[p , 0] && !IntegerQ[1/n] && !ILtQ[Simplify[1/n + p], 0] && (IntegerQ[p] || GtQ[a, 0])
Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^IntPart[p]*((a + b*x ^n)^FracPart[p]/(1 + b*(x^n/a))^FracPart[p]) Int[(1 + b*(x^n/a))^p, x], x ] /; FreeQ[{a, b, n, p}, x] && !IGtQ[p, 0] && !IntegerQ[1/n] && !ILtQ[Si mplify[1/n + p], 0] && !(IntegerQ[p] || GtQ[a, 0])
Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Si mp[d*x*((a + b*x^n)^(p + 1)/(b*(n*(p + 1) + 1))), x] - Simp[(a*d - b*c*(n*( p + 1) + 1))/(b*(n*(p + 1) + 1)) Int[(a + b*x^n)^p, x], x] /; FreeQ[{a, b , c, d, n, p}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]
Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[d*x*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q - 1)/(b*(n*(p + q) + 1))), x] + Simp[1/(b*(n*(p + q) + 1)) Int[(a + b*x^n)^p*(c + d*x^n)^(q - 2)*Sim p[c*(b*c*(n*(p + q) + 1) - a*d) + d*(b*c*(n*(p + 2*q - 1) + 1) - a*d*(n*(q - 1) + 1))*x^n, x], x], x] /; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d , 0] && GtQ[q, 1] && NeQ[n*(p + q) + 1, 0] && !IGtQ[p, 1] && IntBinomialQ[ a, b, c, d, n, p, q, x]
\[\int \left (a +b \,x^{n}\right )^{p} \left (c +d \,x^{n}\right )^{2}d x\]
\[ \int \left (a+b x^n\right )^p \left (c+d x^n\right )^2 \, dx=\int { {\left (d x^{n} + c\right )}^{2} {\left (b x^{n} + a\right )}^{p} \,d x } \]
Result contains complex when optimal does not.
Time = 17.30 (sec) , antiderivative size = 175, normalized size of antiderivative = 0.87 \[ \int \left (a+b x^n\right )^p \left (c+d x^n\right )^2 \, dx=\frac {a^{\frac {1}{n}} a^{p - \frac {1}{n}} c^{2} x \Gamma \left (\frac {1}{n}\right ) {{}_{2}F_{1}\left (\begin {matrix} \frac {1}{n}, - p \\ 1 + \frac {1}{n} \end {matrix}\middle | {\frac {b x^{n} e^{i \pi }}{a}} \right )}}{n \Gamma \left (1 + \frac {1}{n}\right )} + \frac {2 a^{1 + \frac {1}{n}} a^{p - 1 - \frac {1}{n}} c d x^{n + 1} \Gamma \left (1 + \frac {1}{n}\right ) {{}_{2}F_{1}\left (\begin {matrix} - p, 1 + \frac {1}{n} \\ 2 + \frac {1}{n} \end {matrix}\middle | {\frac {b x^{n} e^{i \pi }}{a}} \right )}}{n \Gamma \left (2 + \frac {1}{n}\right )} + \frac {a^{2 + \frac {1}{n}} a^{p - 2 - \frac {1}{n}} d^{2} x^{2 n + 1} \Gamma \left (2 + \frac {1}{n}\right ) {{}_{2}F_{1}\left (\begin {matrix} - p, 2 + \frac {1}{n} \\ 3 + \frac {1}{n} \end {matrix}\middle | {\frac {b x^{n} e^{i \pi }}{a}} \right )}}{n \Gamma \left (3 + \frac {1}{n}\right )} \]
a**(1/n)*a**(p - 1/n)*c**2*x*gamma(1/n)*hyper((1/n, -p), (1 + 1/n,), b*x** n*exp_polar(I*pi)/a)/(n*gamma(1 + 1/n)) + 2*a**(1 + 1/n)*a**(p - 1 - 1/n)* c*d*x**(n + 1)*gamma(1 + 1/n)*hyper((-p, 1 + 1/n), (2 + 1/n,), b*x**n*exp_ polar(I*pi)/a)/(n*gamma(2 + 1/n)) + a**(2 + 1/n)*a**(p - 2 - 1/n)*d**2*x** (2*n + 1)*gamma(2 + 1/n)*hyper((-p, 2 + 1/n), (3 + 1/n,), b*x**n*exp_polar (I*pi)/a)/(n*gamma(3 + 1/n))
\[ \int \left (a+b x^n\right )^p \left (c+d x^n\right )^2 \, dx=\int { {\left (d x^{n} + c\right )}^{2} {\left (b x^{n} + a\right )}^{p} \,d x } \]
Exception generated. \[ \int \left (a+b x^n\right )^p \left (c+d x^n\right )^2 \, dx=\text {Exception raised: TypeError} \]
Exception raised: TypeError >> an error occurred running a Giac command:IN PUT:sage2:=int(sage0,sageVARx):;OUTPUT:Unable to divide, perhaps due to ro unding error%%%{-1,[1,0,4,3,1,3,3,2,0]%%%}+%%%{-3,[1,0,4,3,1,2,3,2,0]%%%}+ %%%{-3,[1
Timed out. \[ \int \left (a+b x^n\right )^p \left (c+d x^n\right )^2 \, dx=\int {\left (a+b\,x^n\right )}^p\,{\left (c+d\,x^n\right )}^2 \,d x \]